import http from "~/utils/http";
export const getOrder = params => {
  return http({
    url: "buy/record/list",
    method: "get",
    params
  });
};
export const saveOrder = data => {
  return http({
    url: "buy/course",
    method: "post",
    data
  });
};
export const getOrderList = params => {
  return http({
    url: "buy/paid/list",
    method: "get",
    params
  });
};
export const getAllCourseList = (data) => {
  return http({
    url: "course/list",
    method: "post",
    data
  });
};
export const getWaterList = data => {
  return http({
    url: "client/order/list",
    method: "post",
    data
  });
};
export const getBuyWaterList = data => {
  return http({
    url: "buyLog/expenseCalendar",
    method: "post",
    data
  });
};
export const getActivationRecordList = data => {
  return http({
    url: "client/myStudyCard",
    method: "post",
    data
  });
};
// 获取我的课程接口
export const getMyOrderList = params => {
  return http({
    url: "buy/record/myCourse",
    method: "get",
    params
  });
};
// 生成订单
export const generateOrder = data => {
  return http({
    url: "buyOrderInfo/createBuyOrder",
    method: "post",
    data
  });
};
// 课程购买pc支付宝支付
export const getCourseBuyToPcAlipay = (orderNo) => {
  return http({
    url: "buyOrderInfo/alipay/pc?orderNo="+orderNo,
    method: "get",
  });
};
// 课程购买H5支付宝支付
export const getCourseBuyToH5Alipay = (orderNo) => {
  return http({
    url: "buyOrderInfo/alipay/h5?orderNo="+orderNo,
    method: "get",
  });
};
//课程购买微信H5支付
export const getCourseBuyToH5Wx = params => {
  return http({
      url: "buyOrderInfo/wx/h5",
      method: "get",
      params
  });
};
//课程购买微信内置支付授权
export const getCourseBuyWxAuthorization = params => {
  return http({
      url: "buyOrderInfo/wx/authorizeurl",
      method: "get",
      params
  });
};
//课程购买微信内置浏览器支付
export const getCourseBuyWxBrowserPay = params => {
  return http({
      url: "buyOrderInfo/wx/unifiedOrder",
      method: "get",
      params
  });
};
//课程购买微信App支付
export const getCourseBuyWxAppPay = params => {
  return http({
      url: "buyOrderInfo/wx/app",
      method: "get",
      params
  });
};
//课程购买支付宝App支付
export const getCourseBuyAlipayAppPay = data => {
  return http({
      url: "buyOrderInfo/alipay/app",
      method: "post",
      data
  });
};